#include <QApplication>
#define CONFIG_PATH ":/config/config.json"
#include <QDebug>
#include "utils/database/DatabaseUtil.h"
#include "utils/handler/log/LogService.h"
#include "utils/httpUtil/HttpUtil.h"
#include "utils/handler/user/UserHandler.h"

int main(int argc, char *argv[]) {
    QApplication a(argc, argv);

    // 初始化数据库
    if (!DatabaseUtil::getInstance().init(CONFIG_PATH)) {
        qDebug() << "Failed to init database";
        return -1;
    }

    // 初始化日志系统
    LogService::getInstance().init(true, "INFO");

    // 初始化HttpUtil
    HttpUtil::getInstance().init();

    // 注册路由
    UserHandler::registerRoutes();

    return QApplication::exec();
}
